package net.esj.basic.core.business.po.item;

import java.io.Serializable;
import java.util.Collections;
import java.util.Map;

import net.esj.basic.core.view.support.vojo.BaseVojo;
import net.esj.basic.core.view.support.vojo.TransObject;
import net.esj.basic.pojo.Empty;

public class ItemTemplateVo implements ItemTemplate, BaseVojo<Serializable>,
		TransObject {
	
	private Serializable id;
	private String dependId;
	private boolean canOverlay;
	
	private Map shows;
	
	private Map selections;
	
	private Map titles;
	
	private String title;
	
	private int maxCount;
	
	private String mType;
	
	public Serializable getId() {
		return id;
	}

	public void setId(Serializable id) {
		this.id = id;
	}

	public boolean isCanOverlay() {
		return canOverlay;
	}

	public void setCanOverlay(boolean canOverlay) {
		this.canOverlay = canOverlay;
	}

	public Map getShows() {
		return shows;
	}

	public void setShows(Map shows) {
		this.shows = shows;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public int getMaxCount() {
		return maxCount;
	}

	public void setMaxCount(int maxCount) {
		this.maxCount = maxCount;
	}

	public void setMType(String mType) {
		this.mType = mType;
	}

	@Override
	public boolean canOverlay() {
		return canOverlay;
	}

	@Override
	public int maxCount() {
		return maxCount;
	}

	@Override
	public String getMType() {
		return mType;
	}

	@Override
	public Map getSelections() {
		return selections;
	}

	public void setSelections(Map selections) {
		this.selections = selections;
	}

	@Override
	public Map getTitles() {
		return titles;
	}

	public void setTitles(Map titles) {
		this.titles = titles;
	}
	@Override
	public String getDependId() {
		return dependId;
	}
	
	public void setDependId(String dependId) {
		this.dependId = dependId;
	}

	public static class EmptyItemTemplate implements ItemTemplate,Empty{

		private String title="";
		
		@Override
		public String getName() {
			return title;
		}

		@Override
		public Serializable getId() {
			return "";
		}

		@Override
		public String getMType() {
			return "EMPTY";
		}

		@Override
		public Map getShows() {
			return Collections.EMPTY_MAP;
		}

		@Override
		public Map getSelections() {
			return Collections.EMPTY_MAP;
		}

		@Override
		public Map getTitles() {
			return Collections.EMPTY_MAP;
		}

		@Override
		public boolean canOverlay() {
			return false;
		}

		@Override
		public int maxCount() {
			return 0;
		}

		public void setTitle(String title) {
			this.title = title;
		}

		@Override
		public String getDependId() {
			return "";
		}
		
	}
	
	public static final EmptyItemTemplate EMPTY= new EmptyItemTemplate(); 
	public static final EmptyItemTemplate NOT_EXISTS= new EmptyItemTemplate(); 
	static {
		NOT_EXISTS.setTitle("<font color=\"RED\">该产品已不存在</font>");
	}
	@Override
	public String getName() {
		return title;
	}
}
